def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)

def ngcd(xlist,n):
    if n == 1:
        return xlist[0]
    else:
        return gcd(xlist[n-1],ngcd(xlist,n-1))

def lcm(a,b):
    return a*b/gcd(a,b)

def nlcm(xlist,n):
    if n == 1:
        return xlist[0]
    else:
        return lcm(xlist[n-1],nlcm(xlist,n-1))
n = int(input("请输入要输入数字的个数："))
print("请输入{}个数字".format(n))
xlist = []
for i in range(0,n):
    x = int(input())
    xlist.append(x)
print("最大公约数为{},最大公倍数为{}".format(ngcd(xlist,n),nlcm(xlist,n)))